﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using RaisingStudio.SmallProgram.Library;
using RaisingStudio.SmallProgram.Library.Internal;

namespace RaisingStudio.SmallProgram.Silverlight.Test
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            GraphicsWindow.Initialize();
            TextWindow.Initialize();
            this.windowHost.Children.Add(GraphicsWindow.Element);
            this.windowHost.Children.Add(TextWindow.Element);

            GraphicsWindow.DrawLine(0, 0, 100, 100);

            TextWindow.WriteLine("hello");
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {            
            Sound.PlayBellRingAndWait();
           // GraphicsWindow.DrawLine(0, 0, 10, 10);
            for (int i = 0; i < 10; i++)
            {

                //string filename = "C:\\Windows\\Media\\tada.wav";
                //System.IO.Stream stream = System.IO.File.Open(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
                //using (System.IO.BinaryReader reader = new System.IO.BinaryReader(stream))
                //{
                //    byte[] buffer = reader.ReadBytes((int)stream.Length);
                //    System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(buffer);
                //    System.Media.SoundPlayer sp = new System.Media.SoundPlayer(memoryStream);
                //    sp.PlaySync();
                //}

                //for (int i = 0; i < 10; i++)
                //{
               // Sound.PlayTada();
             Sound.PlayBellRing();
             Sound.PlayChime();
             Sound.PlayChimes();
             Sound.PlayClick();
                
           }
            //GraphicsWindow.DrawLine(20, 20, 30, 30);
        }
    }
}
